package com.yfp.client.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfp.client.domain.OrderDetailWait;
import com.yfp.client.service.OrderDetailWaitService;
import com.yfp.client.mapper.OrderDetailWaitMapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author admin
 * @description 针对表【order_detail_wait(订单预计排队时间)】的数据库操作Service实现
 * @createDate 2024-09-04 13:57:21
 */
@Slf4j
@Service
public class OrderDetailWaitServiceImpl extends ServiceImpl<OrderDetailWaitMapper, OrderDetailWait> implements OrderDetailWaitService {

    @Resource
    private OrderDetailWaitMapper orderDetailWaitMapper;

    @Override
    public void updateStatusByOrderDetailId(List<String> orderDetailIds, int status) {
        if (CollUtil.isEmpty(orderDetailIds)) {
            return;
        }
        orderDetailWaitMapper.updateStatusByOrderDetailId(orderDetailIds, status);
    }

    @Override
    public void updateStatus0To2ForPreviousDay() {
        log.info("更新前一天order_detail_wait 状态为0 的数据为 2");
        orderDetailWaitMapper.updateStatus0To2ForPreviousDay();
    }
}




